<?php namespace Common\Model;
use Hdphp\Model\Model;

class Type extends Model{
	protected $table = "360mall_type";
	//自动验证
	protected $validate = array(
	 array("type_name","required","请输入类型名称",3,3),
	 array("type_name","unique","类型名已存在",3,3),
	);
	public function store(){
		if(!$this->create()) return false;
	    return  $this->add();
	}
	//编辑
	public function edit($type_id){
		if(!$this->create()) return false;
		
		$this->save();
		return true;
		
	}
	
}
	